// @Author EthanScriptOn
// @Desc
package service

import (
	"gitee.com/fatzeng/srf_switch_dynamic_logic_director/common"
	"gitee.com/fatzeng/srf_switch_dynamic_logic_director/dto"
)

func SystemInfo() (info *dto.SystemInformation, err error) {
	info.CurrentEnv = common.SrfDirectorGlobalConfig.SrfEnvConfig.SrfEnv
	locatorConfigs := common.SrfDirectorGlobalConfig.SrfLocatorConfig
	information := make([]*dto.LocatorInformation, len(locatorConfigs))
	for _, config := range locatorConfigs {
		lInfo := new(dto.LocatorInformation)
		lInfo.Namespace = config.SrfNamespace
		lInfo.Group = config.SrfGroup
		information = append(information, lInfo)
	}
	info.Locators = information
	return
}
